package com.qdxwx.data.service.company;

import com.qdxwx.common.exception.AccountException;
import com.qdxwx.common.page.PageRequest;
import com.qdxwx.models.company.CompanyAccount;
import com.qdxwx.models.enums.AccountBizType;

import java.util.List;

/**
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
public interface CompanyAccountService {

    int insert(CompanyAccount account);

    CompanyAccount create(int companyId);

    int update(CompanyAccount account);

    /**
     * 账户扣款，消费，出账
     */
    int deduct(int companyId, int amount, int orderId, String description,
               AccountBizType accountBizType) throws AccountException;

    /**
     * 账户入账,充值
     */
    int income(int companyId, int amount, int orderId, String description,
               AccountBizType accountBizType) throws AccountException;


    int deleteById(int companyId);

    CompanyAccount get(int companyId);

    List<CompanyAccount> getList(CompanyAccount account, PageRequest page);

    long count(CompanyAccount account);

}
